package Demo;

import java.util.Arrays;
import java.util.Scanner;

public class Test {
    //    public static void main(String[] args) {
//        int[] array = {1,2,3,4,5,6,7};
//        rotate(array,3);
//    }
//
//    public static void rotate(int[] nums, int k) {
//        int pos1 = k;
//        if(k>=nums.length){
//            pos1 = k%nums.length;
//        }
//        int[] newArray = new int[nums.length];
//        int target = nums.length - pos1;
//        int pos = 0;
//        for(int i = target;i<nums.length;i++){
//            newArray[pos++] = nums[i];
//        }
//        for(int j = 0;j<target;j++){
//            newArray[pos++] = nums[j];
//        }
//        System.arraycopy(newArray,0,nums,0,newArray.length);
//
//    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入用户名：");
        String useName = scanner.nextLine();
        System.out.print("请输入密码：");
        String password = scanner.nextLine();
        User user = new User("zjy123","zzz12345");
        isEquals(user,useName,password);
    }
    public static void isEquals(User user,String useName,String password){
        if(!useName.equals(user.getUseName())){
            throw new UseNameException("您输入的用户名错误！！！");
        }
        if(!password.equals(user.getPassword())){
            throw new PasswordException("您输入的密码错误！！！");
        }
        System.out.println("登录成功......");
    }
}
